package sdu.icat.pj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import sdu.icat.pj.repository.SysSessionRepository;
import sdu.icat.sys.smodel.SysSession;

/**
 * 会话管理层服务
 * @author ljh_2015
 *
 */
@Service(value="sys_session_service")
public class SysSessionService {

    @Autowired
    private SysSessionRepository sysSessionRepository;
    
    public List<SysSession> querySessionIdByAccount(String account) {
	List<SysSession> sessions = sysSessionRepository.findByAccount(account);
	return sessions;
    }
    
    public void deleteBySessionId(SysSession session) {
	sysSessionRepository.delete(session);
    }
    
    public void update(SysSession session) {
	sysSessionRepository.save(session);
    }
}
